import pandas as pd
import plotly.express as px
from plotly.subplots import make_subplots
import plotly.graph_objects as go
report_1 = pd.read_csv(r"C:\Users\berat\OneDrive\Masaüstü\PICS\Logs\pics_log-2022-12-21-16-53-38\Report\1.report_simulation_trace_broker.csv")
report_1
| CLOCK | JOB_RECV(CUMM) | JOB_RECV(UNIT) | JOB_COMP(CUMM) | JOB_COMP(UNIT) | VM_RUN | VM_STUP | VM_ACT | VM_STOP | VM_COST($) | |
|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 60 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.0 |
| 1 | 120 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 1.6 |
| 2 | 180 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1.6 |
| 3 | 240 | 2 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 1.6 |
| 4 | 300 | 2 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1.6 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 165 | 9960 | 99 | 1 | 96 | 0 | 2 | 0 | 2 | 35 | 59.2 |
| 166 | 10020 | 100 | 1 | 97 | 1 | 2 | 0 | 2 | 35 | 59.2 |
| 167 | 10080 | 100 | 0 | 98 | 1 | 2 | 0 | 2 | 35 | 59.2 |
| 168 | 10140 | 100 | 0 | 98 | 0 | 2 | 0 | 2 | 35 | 59.2 |
| 169 | 10200 | 100 | 0 | 99 | 1 | 1 | 0 | 1 | 36 | 59.2 |
170 rows × 10 columns
report_2 = pd.read_csv(r"C:\Users\berat\OneDrive\Masaüstü\PICS\Logs\pics_log-2022-12-21-16-58-07\Report\1.report_simulation_trace_broker.csv")
report_2['vertical-scaling'] = "On"
report_1['vertical-scaling'] = "Off"
df = pd.concat([report_1, report_2])
fig = px.line(df, x="CLOCK", y="VM_COST($)", color='vertical-scaling')
fig.show()
report_1 = pd.read_csv(r"Logs\pics_log-2022-12-21-17-17-41\Report\1.report_simulation_trace_broker.csv")
report_1["scenario"] = "small workload"
report_2 = pd.read_csv(r"Logs\pics_log-2022-12-21-17-20-55\Report\1.report_simulation_trace_broker.csv")
report_2["scenario"] = "high workload"
df = pd.concat([report_1, report_2])
fig = px.line(df, x="CLOCK", y="VM_COST($)", color='scenario')
fig.update_xaxes(range = [0, 10000])
fig.update_yaxes(range = [0, 100])
fig.show()
report_1['SUM_VM_STUP'] = report_1['VM_STUP'].cumsum(axis = 0)
report_2['SUM_VM_STUP'] = report_2['VM_STUP'].cumsum(axis = 0)
df = pd.concat([report_1, report_2])
fig = px.line(df, x="CLOCK", y="SUM_VM_STUP", color='scenario')
fig.update_xaxes(range = [0, 10000])
fig.show()
report_3 = pd.read_csv(r"Logs\pics_log-2022-12-21-17-59-25\Report\1.report_simulation_trace_broker.csv")
report_3["scenario"] = "increased network bandwidth"
fig1 = px.line(report_3, x="CLOCK", y="VM_COST($)", color='scenario')
fig1.show()
report_2["scenario"] = "default network bandwidth"
fig2 = px.line(report_2, x="CLOCK", y="VM_COST($)", color='scenario')
fig2.show()
fig = make_subplots(rows=2, cols=1)
fig.add_trace(
go.Scatter(x=report_2["CLOCK"], y=report_2["VM_COST($)"], mode = "lines", name = "default"),
row=1, col=1
)
fig.add_trace(
go.Scatter(x=report_3["CLOCK"], y=report_3["VM_COST($)"], mode = "lines", name = "increased"),
row=2, col=1
)
fig.update_xaxes(title_text="CLOCK", row=1, col=1)
fig.update_xaxes(title_text="CLOCK", row=2, col=1)
fig.update_yaxes(title_text="VM_COST($)", row=1, col=1)
fig.update_yaxes(title_text="VM_COST($)", range=[0, 600], row=2, col=1)
fig.show()